package vip.youngboy.freejump.handler.task;

import org.springframework.stereotype.Component;
import vip.youngboy.freejump.constant.TaskActionType;
import vip.youngboy.freejump.domain.FlowRequestParam;
import vip.youngboy.freejump.domain.TaskActionModel;
import vip.youngboy.freejump.domain.process.Option;

import java.util.List;

@Component
public class TaskLockActionHandler extends AbstractTaskActionHandler {

    @Override
    public void doHandleAction(TaskActionModel taskActionModel) {
        //执行锁定逻辑
        taskService.claim(taskActionModel.getFlowRequestParam().getTaskId(), taskActionModel.getAssign());
    }

    @Override
    public void vaildOptions(FlowRequestParam flowRequestParam) {

    }

    @Override
    public TaskActionType supportAction() {
        return TaskActionType.LOCK;
    }

    @Override
    public List<Option> getOptions() {
        return null;
    }

}
